package newCode;


import tree.TreeNode;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;

/**
 *      5
 *    3   6
 *   2  4
 * 二叉树转链表
 * @author gaolainan
 */
public class LevelTraversalBinaryTree
{
    public static void main(String[] args)
    {
        ///TreeNode root = new TreeNode(5,new TreeNode(3,new TreeNode(2),new TreeNode(4)),new TreeNode(6));
        ///levelSearch(root);
        char[] a = {'a','d','c'};
        System.out.println(new String(a));
    }

    public ArrayList<ArrayList<Integer>> levelOrder (TreeNode root) {
        // write code here
        ArrayList<ArrayList<Integer>> list = new ArrayList<>();




        return list;
    }

    private static void levelSearch(TreeNode root){
        Queue<TreeNode> queue = new LinkedList<>();
        if (root != null){
            queue.add(root);
        }
        while(!queue.isEmpty()){
            TreeNode node = queue.poll();
            System.out.println(node.val);
            if (node.left != null){
                queue.add(node.left);
            }
            if (node.right != null){
                queue.add(node.right);
            }
        }
    }
}
